<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="style.css" type="text/css">
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link rel="Start" href="index.html">
<link rel="previous" href="Lwt_mutex.html">
<link rel="next" href="Lwt_timeout.html">
<link rel="Up" href="index.html">
<link title="Index of types" rel=Appendix href="index_types.html">
<link title="Index of exceptions" rel=Appendix href="index_exceptions.html">
<link title="Index of values" rel=Appendix href="index_values.html">
<link title="Index of class methods" rel=Appendix href="index_methods.html">
<link title="Index of class types" rel=Appendix href="index_class_types.html">
<link title="Index of modules" rel=Appendix href="index_modules.html">
<link title="Index of module types" rel=Appendix href="index_module_types.html">
<link title="Dom" rel="Chapter" href="Dom.html">
<link title="Gears" rel="Chapter" href="Gears.html">
<link title="Javascript" rel="Chapter" href="Javascript.html">
<link title="Jslib_ast" rel="Chapter" href="Jslib_ast.html">
<link title="Jslib_lexer" rel="Chapter" href="Jslib_lexer.html">
<link title="Jslib_parse" rel="Chapter" href="Jslib_parse.html">
<link title="Jslib_pp" rel="Chapter" href="Jslib_pp.html">
<link title="Lwt" rel="Chapter" href="Lwt.html">
<link title="Lwt_dom" rel="Chapter" href="Lwt_dom.html">
<link title="Lwt_mutex" rel="Chapter" href="Lwt_mutex.html">
<link title="Lwt_pool" rel="Chapter" href="Lwt_pool.html">
<link title="Lwt_timeout" rel="Chapter" href="Lwt_timeout.html">
<link title="Lwt_util" rel="Chapter" href="Lwt_util.html">
<link title="Mozilla" rel="Chapter" href="Mozilla.html">
<link title="Ocamljs" rel="Chapter" href="Ocamljs.html"><title>Lwt_pool</title>
</head>
<body>
<div class="navbar"><a href="Lwt_mutex.html">Previous</a>
&nbsp;<a href="index.html">Up</a>
&nbsp;<a href="Lwt_timeout.html">Next</a>
</div>
<center><h1>Module <a href="type_Lwt_pool.html">Lwt_pool</a></h1></center>
<br>
<pre><span class="keyword">module</span> Lwt_pool: <code class="code">sig</code> <a href="Lwt_pool.html">..</a> <code class="code">end</code></pre>Creating pools (for example pools of connections to a database).<br>
<hr width="100%">
<br>
Instead of creating a new connection each time you need one,
    keep a pool of opened connections and reuse opened connections
    that are free.<br>
<pre><span class="keyword">type</span> <a name="TYPEt"></a><code class="type">'a</code> t </pre>
<div class="info">
Type of pools<br>
</div>

<pre><span class="keyword">val</span> <a name="VALcreate"></a>create : <code class="type">int -><br>       ?check:('a -> (bool -> unit) -> unit) -> (unit -> 'a <a href="Lwt.html#TYPEt">Lwt.t</a>) -> 'a <a href="Lwt_pool.html#TYPEt">t</a></code></pre><div class="info">
<code class="code">create n f</code> creates a new pool with at most <code class="code">n</code> members.
    <code class="code">f</code> is the function to use to create a new pool member.<br>
</div>
<pre><span class="keyword">val</span> <a name="VALuse"></a>use : <code class="type">'a <a href="Lwt_pool.html#TYPEt">t</a> -> ('a -> 'b <a href="Lwt.html#TYPEt">Lwt.t</a>) -> 'b <a href="Lwt.html#TYPEt">Lwt.t</a></code></pre><div class="info">
<code class="code">use p f</code> takes one free member of the pool <code class="code">p</code> and gives it to the function
    <code class="code">f</code>.<br>
</div>
</body></html>